package ar.edu.itba.it.pdc.proxy.stats;

import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateTime;

public class ClientStatistics {
	
	private int mailsRead;
	private int mailsDeleted;
	private long bytesSent;
	private long bytesReceived;	
	private List<DateTime> accesses;
	
	public ClientStatistics(){
		this.mailsRead = 0;
		this.mailsDeleted = 0;
		this.bytesSent = 0;
		this.bytesReceived = 0;
		this.accesses = new ArrayList<DateTime>();
	}

	public int getMailsRead() {
		return mailsRead;
	}

	public int getMailsDeleted() {
		return mailsDeleted;
	}

	public long getBytesSent() {
		return bytesSent;
	}

	public long getBytesReceived() {
		return bytesReceived;
	}
	
	public void incrementMailsReadBy(int n) {
		this.mailsRead += n;
	}

	public void incrementMailsDeletedBy(int n) {
		this.mailsDeleted += n;
	}

	public void incrementBytesSentBy(long n) {
		this.bytesSent += n;
	}

	public void incrementBytesReceivedBy(long n) {
		this.bytesReceived += n;
	}
	
	public List<DateTime> getAccesses(){
		return accesses;
	}
	
	public int accessesQuantity(){
		return accesses.size();
	}
	
	public void addAccess(DateTime date){
		this.accesses.add(date);
	}
}
